home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / tp5patch.arc / INT60.PAT next >
Text File  |  1991-04-28  |  1KB  |  40 lines

  1. program TP5Patch;
  2. { Program to patch TURBO.EXE version 5.0 for the problem with }
  3. { the vector for interrupt $60 getting changed in the IDE.    }
  4. uses
  5.   Dos;
  6. const
  7.   PatchFileName : string = 'TURBO.EXE';  { Name of file to be patched }
  8.   PatchByte     : byte   = $02;          { Value to be patched in }
  9.   PatchOffset   : word   = $1476;        { Offset of patch location }
  10. var
  11.   PatchFile : file of byte;
  12.   OrgByte   : byte;
  13. begin
  14.   if FSearch(PatchFileName, '') = '' then
  15.     Writeln(PatchFileName, ' not found.')  { Can't find the file }
  16.   else
  17.     begin
  18.       Assign(PatchFile, PatchFileName);
  19.       {$I-} Reset(PatchFile); {$I+}
  20.       if IOResult <> 0 then
  21.       begin
  22.         Writeln('I/O error on Reset.');
  23.         Halt;
  24.       end;
  25.       Seek(PatchFile, PatchOffset);
  26.       Read(PatchFile, OrgByte);            { Read byte at patch location }
  27.       case OrgByte of
  28.         4 : begin
  29.               Seek(PatchFile, PatchOffset);
  30.               Write(PatchFile, PatchByte);
  31.               Writeln('Patch successfully applied.');
  32.             end;
  33.         2 : Writeln('Patch already applied.');
  34.       else
  35.         Writeln('No patch applied.');
  36.       end;
  37.       Close(PatchFile);
  38.     end;
  39. end.
  40.